//
//  UIButton+Extension.swift
//  MyWeibo
//
//  Created by tanchao on 15/8/10.
//  Copyright © 2015年 chaoren. All rights reserved.
//

import UIKit
// MARK: -UIButton
extension UIButton{
    /// UIButton:便利构造函数
    ///
    /// - parameter title    : 按钮文本
    /// - parameter imageName: 按钮图标
    /// - parameter fontSize : 文本字体大小
    /// - parameter color    : 文本颜色
    ///
    /// - returns: UIButton
    convenience init(title: String, imageName: String, fontSize: CGFloat = 12, color: UIColor = UIColor.darkGrayColor()) {
        self.init()
        setTitle(title, forState: UIControlState.Normal)
        setImage(UIImage(named: imageName), forState: UIControlState.Normal)
        setTitleColor(color, forState: UIControlState.Normal)
        titleLabel?.font = UIFont.systemFontOfSize(fontSize)
    }
}